import service from "../index";

//获取订单列表
export const getAllOrder = async () => {
  return await service({
    method: "get",
    url: "/order/getAllOrder",
  });
};

//删除
export const deleteOrder = async (id: number) => {
  return await service({
    method: "post",
    url: "/order/deleteOrder",
    data: { id: id },
  });
};

//批量删除
export const batchDeleteOrder = async (ids: []) => {
  return await service({
    method: "post",
    url: "/order/batchDeleteOrder",
    data: { ids: ids },
  });
};

// 搜索
export const searchOrder = async (params: any) => {
  return await service({
    method: "post",
    url: "/order/searchOrder",
    data: params,
  });
};

//新增
export const addOrder = async (data: any) => {
  return await service({
    method: "post",
    url: "/order/addOrder",
    data: data,
  });
};

//修改
export const updateOrder = async (data: any) => {
  return await service({
    method: "post",
    url: "/order/updateOrder",
    data: data,
  });
};

//导出
export const exportExcel = async (data: any) => {
  return await service({
    method: "post",
    url: "/order/exportExcel",
    data: data,
  });
};
